package com.yj.springbootparams_analysis.rest;

import com.yj.springbootparams_analysis.entity.Info;
import com.yj.springbootparams_analysis.req.CommentReq;
import com.yj.springbootparams_analysis.service.InfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class TestController {

    @Autowired
    InfoService infoService;

    @PostMapping("insert")
    public String insert(Info info){

        CommentReq commentReq = infoService.getCommentReq();
        log.info("commentReq:{}",commentReq);
        return "success";
    }

    @PostMapping("insert2")
    public String insert(CommentReq commentReq){

        log.info("commentReq:{}",commentReq);
        return "success";
    }


}
